package ml;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.TreeSet;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import ml.ArffPathUtil;
import ml.ArffPathUtil.Part;
import ml.ArffPathUtil.Preprocessed;
import ml.ArffPathUtil.Sampling;
import ml.ArffPathUtil.Type;
import ml.evaluation.EvaluationResult;
import ml.evaluation.IBkClassification;
import ml.evaluation.RandomForestClassification;
import ml.evaluation.SMOClassification;
import ml.preprocessing.FilterRemoveRunnable;
import ml.preprocessing.FilterResampleRunnable;
import ml.preprocessing.MusicAttribMerge;

import weka.classifiers.Evaluation;
import weka.classifiers.trees.RandomForest;
import weka.core.Instances;

public class Main {
	public static String DATA_DIRECTORY;
	public static String WORKING_DIRECTORY;
	// private static final int EXECUTOR_CORE_POOL_SIZE = 1;
	private static final int EXECUTOR_CORE_POOL_SIZE = Runtime.getRuntime()
			.availableProcessors() - 1;
	private static final int EXECUTOR_SHUTDOWN_TIMEOUT = 30;

	private static ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors
			.newScheduledThreadPool(EXECUTOR_CORE_POOL_SIZE);
	private static UpAndCountDownLatch latch = new UpAndCountDownLatch();
	private static CopyOnWriteArrayList<EvaluationResult> results = new CopyOnWriteArrayList<EvaluationResult>();

	public static void main(final String[] args) throws Exception {
		if (args.length != 1) {
			throw new IllegalArgumentException(
					"1st argument missing: Data Directory");
		}
		if (!(new File(args[0]).exists())) {
			throw new IllegalArgumentException("Data Directory not found");
		}
		DATA_DIRECTORY = args[0];
		WORKING_DIRECTORY = DATA_DIRECTORY + "../";

		// double[] lc = new double[12];
		// double[] lg = new double[12];
		// for (int i = 0; i < lc.length; i++) {
		// lc[i] = Math.pow(2, (i + 1));
		// lg[i] = Math.pow(2, (i - 12));
		// }
		// Instances trainingData = WekaUtil.loadData(ArffPathUtil.getPath(
		// Part.training, Type.music, Preprocessed.merged, Sampling.p1));
		// Instances testData = WekaUtil.loadData(ArffPathUtil.getPath(
		// Part.testing, Type.music, Preprocessed.merged, Sampling.p1));
		// for (double c : lc) {
		// for (double g : lg) {
		// executor.submit(new SMOClassification(latch, trainingData,
		// testData, results, c, g));
		// }
		// }

		// executor.submit(new MusicAttribMerge(latch, ArffPathUtil.getPath(
		// Part.training, Type.music, Preprocessed.all, Sampling.all),
		// ArffPathUtil.getPath(Part.training, Type.music,
		// Preprocessed.merged, Sampling.all)));
		// executor.submit(new MusicAttribMerge(latch, ArffPathUtil.getPath(
		// Part.testing, Type.music, Preprocessed.all, Sampling.all),
		// ArffPathUtil.getPath(Part.testing, Type.music,
		// Preprocessed.merged, Sampling.all)));

		// for (Part part : EnumSet.of(Part.training, Part.testing)) {
		// Instances data = WekaUtil.loadData(ArffPathUtil.getPath(part,
		// Type.music, Preprocessed.mergednew, Sampling.all));
		// for (Sampling sampling : EnumSet.allOf(Sampling.class)) {
		// executor.submit(new FilterResampleRunnable(latch, data,
		// ArffPathUtil.getPath(part, Type.music,
		// Preprocessed.mergednew, sampling), 1,
		// sampling.value));
		// }
		// }

		// Instances trainingData = WekaUtil.loadData(ArffPathUtil.getPath(
		// Part.training, Type.music, Preprocessed.merged, Sampling.p1));
		// Instances testData = WekaUtil.loadData(ArffPathUtil.getPath(
		// Part.testing, Type.music, Preprocessed.merged, Sampling.p1));

		// for (int numTrees = 10; numTrees <= 100; numTrees += 10) {
		// for (int maxDepth = 3; maxDepth <= 30; maxDepth++) {
		// executor.submit(new RandomForestClassification(latch, trainingData,
		// testData, results, 10, 5));
		// }
		// }

		// for (int knn = 1; knn <= 100; knn++) {
		// executor.submit(new IBkClassification(latch, trainingData,
		// testData, results, knn));
		// }

		// double[] mean = MusicAttribMerge.calcMean(
		// ArffPathUtil.getPath(Part.training, Type.music, Preprocessed.all,
		// Sampling.all),
		// ArffPathUtil.getPath(Part.testing, Type.music, Preprocessed.all,
		// Sampling.all),
		// ArffPathUtil.getPath(Part.contest, Type.music, Preprocessed.all,
		// Sampling.all));

		double[] mean = { 0.4226677523148176, 0.3800951319444406,
				0.3607136689814791, 0.3546647731481465, 0.3254492291666596,
				0.3297175509259221, 0.3363093726851789, 0.3464316157407372,
				0.3347153657407375, 0.3215210462962905, 0.3153262245370332,
				0.2942331944444429, 0.2900299745370306, 0.2853941435185100,
				0.2679090532407389, 0.2456915185185142, 0.2577121805555508,
				0.2519029189814736, 0.2260004120370337, 0.2423587546296265,
				0.2467791759259248, 0.2462496782407400, 0.2448926458333333,
				0.2357874814814764, 0.2378291087962926, 0.2625716921296248,
				0.2692584930555550, 0.2405550416666643, 0.2382154074074033,
				0.2511665578703731, 0.2731029861111073, 0.2658113032407379,
				0.2611772523148060, 0.2519739120370326, 0.2485556296296254,
				0.2557498032407402, 0.2398878310185183, 0.2575510925925898,
				0.2586793217592542, 0.2296258888888902, 0.2327033611111060,
				0.2312417268518481, 0.2206104143518455, 0.2527356111111083,
				0.2579482407407358, 0.2221586041666619, 0.2209302268518456,
				0.2252797060185128, 0.2075538842592511, 0.2124946828703657,
				0.2431028749999942, 0.2277559004629622, 0.1978461018518461,
				0.2160878055555485, 0.2314244074074052, 0.2108568356481439,
				0.1931043680555473, 0.2145755046296294, 0.2185600208333304,
				0.1955834467592514, 0.1902747291666614, 0.2249934050925893,
				0.2423274629629597, 0.2152531828703623, 0.1838892847222170,
				0.1897058865740685, 0.2029305069444373, 0.1907198124999939,
				0.1736634444444417, 0.1796613472222160, 0.2133417037037001,
				0.2266002199074041, 0.1966953402777731, 0.1705787476851803,
				0.1792297361111070, 0.1951322453703631, 0.1946544768518445,
				0.1764544236111039, 0.1632321504629573, 0.1687427291666612,
				0.1954113587962908, 0.2043686087962925, 0.1798884282407362,
				0.1587511481481446, 0.1643231898148146, 0.1856895995370353,
				0.2049067777777744, 0.1964216712962945, 0.1665197129629662,
				0.1513547500000018, 0.1577154675925918, 0.1795017499999973,
				0.1861714837962931, 0.1700854421296278, 0.1499821712962993,
				0.1465081157407415, 0.1583580208333332, 0.1840559282407379,
				0.2118567800925857, 0.2018875787037009, 0.1651278379629602,
				0.1460179699074089, 0.1467407939814857, 0.1574452083333343,
				0.1694986504629661, 0.1704683819444463, 0.1571132430555580,
				0.1447859074074109, 0.1410044652777789, 0.1475612013888904,
				0.1671922870370373, 0.1944462407407388, 0.1972790046296236,
				0.1686325925925916, 0.1453620671296310, 0.1429978171296310,
				0.1517992569444460, 0.1635971504629616, 0.1752871527777769,
				0.1801027754629625, 0.1698815462962976, 0.1538876087962985,
				0.1455195833333347, 0.1453280370370375, 0.1523264027777761,
				0.1674724629629617, 0.1784674884259264, 0.1746432546296291,
				0.1580873055555519, 0.1423955717592593, 0.1390177245370386,
				0.1429632708333352, 0.1521206666666650, 0.1622670138888893,
				0.1787724837962934, 0.1893462754629652, 0.1768152453703732,
				0.1550200555555577, 0.1437675601851884, 0.1429073981481498,
				0.1436121319444488, 0.1499636458333356, 0.1590065185185201,
				0.1604353935185216, 0.1535372129629633, 0.1420648263888938,
				0.1334842847222282, 0.1324200902777838, 0.1336071412037096,
				0.1368257847222279, 0.1461382685185235, 0.1590197708333370,
				0.1732071203703738, 0.1794906203703738, 0.1650781412037056,
				0.1438640462963033, 0.1328437893518580, 0.1296296481481581,
				0.1318686250000095, 0.1392111388888980, 0.1463175092592653,
				0.1493536574074135, 0.1512973449074132, 0.1475772407407493,
				0.1378706064814913, 0.1279040486111228, 0.1230060208333452,
				0.1220875833333438, 0.1222977615740868, 0.1262678287037168,
				0.1358088981481574, 0.1469188356481563, 0.1559450972222309,
				0.1591838657407480, 0.1476200995370453, 0.1335765115740869,
				0.1203097638889008, 0.1154439282407534, 0.1155124004629771,
				0.1203381458333463, 0.1288184490740857, 0.1336191689814936,
				0.1389905000000116, 0.1465210879629724, 0.1524026041666763,
				0.1450321342592706, 0.1345718032407538, 0.1258242731481606,
				0.1214454953703843, 0.1216026504629775, 0.1221351597222331,
				0.1258016134259376, 0.1304431435185283, 0.1386287384259348,
				0.1428647939814887, 0.1431392638888978, 0.1402631805555643,
				0.1305061666666787, 0.1225024861111212, 0.1166555856481620,
				0.1168945208333444, 0.1177414097222342, 0.1220769398148277,
				0.1290360648148274, 0.1320321527777904, 0.1399320902777866,
				0.1495699236111202, 0.1596831666666773, 0.1629149074074189,
				0.1568343611111198, 0.1403772314814928, 0.1285816689814913,
				0.1223266875000107, 0.1188473634259344, 0.1214913310185277,
				0.1232163055555639, 0.1258820138889003, 0.1298603611111207,
				0.1336175208333449, 0.1377175717592697, 0.1418068842592692,
				0.1437520347222308, 0.1371107800926038, 0.1304515324074174,
				0.1238578703703805, 0.1203802222222302, 0.1206287592592713,
				0.1213637986111206, 0.1217241458333424, 0.1233898171296401,
				0.1279162754629724, 0.1312263726851987, 0.1363545231481583,
				0.1388578958333439, 0.1427142777777886, 0.1428344513888980,
				0.1354993726851959, 0.1266088310185313, 0.1162211458333475,
				0.1128605925926078, 0.1110898587963139, 0.1114308333333506,
				0.1140610671296437, 0.1166103194444569, 0.1209801875000156,
				0.1226556828703838, 0.1252093171296426, 0.1273238773148296,
				0.1289712314814940, 0.1292261689814984, 0.1242950648148313,
				0.1178815810185366, 0.1101696296296476, 0.1083568495370564,
				0.1061658796296499, 0.1059926064815018, 0.1067814004629839,
				0.1076920023148365, 0.1085484745370570, 0.1093870879629835,
				0.1130685925926131, 0.1168635810185381, 0.1211951574074259,
				0.1222851435185370, 0.1049566203703965, 0.0834908634259680,
				0.0636871782408051, 0.0467706018519114, 0.0323722592593009,
				0.0242951435185440, 0.0183817777777928, 0.0151135462963048,
				0.0126197129629656, 0.0115877152777775, 0.0114344467592593,
				0.3161578750000056, 0.5038698888888898, 0.4277074444444466,
				0.3525013240740766, 0.4811570185185218, 0.2713613032407416,
				0.3818127453703779, 0.1962288726851836, 0.3078652175925947,
				0.1635702314814845, 0.2296449282407336, 0.1659856967592558,
				0.1426864305555556, 0.1244299351851929, 0.0985129236111396,
				0.0614315648148710, 0.0368624421296701, 0.0200132685185273,
				0.0256799699074281, 0.0144223726851866, 0.0435932106481929,
				0.0379103125000408, 0.1063147083333551, 0.1286359259259296,
				0.1393746782407409, 0.0872392824074454, 0.1626223518518533,
				0.1419676319444470, 0.1820626574074055, 0.1201436319444558,
				0.0979913032407681, 0.1341353726851950, 0.0920039513889200,
				0.1127252268518644, 0.1223172893518632, 0.0787045092592945,
				0.1261829791666769, 0.1326032083333428, 0.1383016828703751,
				0.2019779004629532, 0.1475510810185215, 0.1352035300925995,
				0.1873448703703684, 0.1431548217592636, 0.0986607731481757,
				0.1291665162037125, 0.1101163009259433, 0.1191346990740819,
				0.1660643356481438, 0.1440525972222210, 0.1874525624999934,
				0.1573068958333325, 0.1902529722222164, 0.1959485300925889,
				0.2062457152777681, 0.2284372523148083, 0.2263382476851825,
				0.2514622453703672, 0.2949791898148081, 0.2815142800925864,
				0.2204008888888817, 0.2085234305555478, 0.1752912337962984,
				0.1080404259259341, 0.0353551226852150, 0.0024835902777773,
				0.0016115879629628, 0.0006641273148148, 0.0111291319444451,
				0.0534735787037433, 0.1325932245370421, 0.2275581805555464,
				0.3062585509259193, 0.2910487476851789, 0.3687377152777744,
				0.3834102523148116, 0.4865192175925883, -0.0425726203703706,
				-0.0193814629629625, -0.0060488958333339, -0.0292155439814820,
				0.0042683217592591, 0.0065918217592592, 0.0101222430555559,
				-0.0117162500000002, -0.0131943194444445, -0.0061948217592588,
				-0.0210930300925930, -0.0042032199074071, -0.0046358310185182,
				-0.0174850902777785, -0.0222175347222219, 0.0120206620370375,
				-0.0058092615740733, -0.0259025069444449, 0.0163583425925928,
				0.0044204212962951, -0.0005294976851857, -0.0013570324074076,
				-0.0091051643518514, 0.0020416273148148, 0.0247425833333340,
				0.0066868009259260, -0.0287034513888895, -0.0023396342592592,
				0.0129511504629627, 0.0219364282407405, -0.0072916828703705,
				-0.0046340509259261, -0.0092033402777774, -0.0034182824074075,
				0.0071941736111115, -0.0158619722222218, 0.0176632615740747,
				0.0011282291666666, -0.0290534328703707, 0.0030774722222222,
				-0.0014616342592592, -0.0106313125000000, 0.0321251967592591,
				0.0052126296296295, -0.0357896365740744, -0.0012283773148147,
				0.0043494791666667, -0.0177258217592592, 0.0049407986111113,
				0.0306081921296293, -0.0153469745370372, -0.0299097986111106,
				0.0182417037037037, 0.0153366018518514, -0.0205675717592592,
				-0.0177524675925928, 0.0214711365740736, 0.0039845162037038,
				-0.0229765740740745, -0.0053087175925925, 0.0347186759259264,
				0.0173340578703701, -0.0270742800925933, -0.0313638981481487,
				0.0058166018518521, 0.0132246203703702, -0.0122106944444441,
				-0.0170563680555549, 0.0059979027777775, 0.0336803564814821,
				0.0132585162037032, -0.0299048796296309, -0.0261165925925927,
				0.0086509884259260, 0.0159025092592595, -0.0004777685185185,
				-0.0182000532407408, -0.0132222731481482, 0.0055105787037037,
				0.0266686296296303, 0.0089572500000000, -0.0244801805555553,
				-0.0211372800925928, 0.0055720416666664, 0.0213664097222220,
				0.0192171782407402, -0.0084851064814816, -0.0299019583333343,
				-0.0151649629629627, 0.0063607175925924, 0.0217862824074071,
				0.0066697337962965, -0.0160860416666669, -0.0201032708333332,
				-0.0034740555555555, 0.0118499050925924, 0.0256979074074079,
				0.0278008518518519, -0.0099692013888887, -0.0367597407407422,
				-0.0191098680555556, 0.0007228240740741, 0.0107044143518518,
				0.0120534421296291, 0.0009697314814814, -0.0133551388888890,
				-0.0123273356481480, -0.0037814421296296, 0.0065567361111112,
				0.0196310856481485, 0.0272539537037041, 0.0028327638888889,
				-0.0286464120370377, -0.0232705254629628, -0.0023642500000000,
				0.0088014398148143, 0.0117978935185183, 0.0116900023148146,
				0.0048156226851852, -0.0102212291666666, -0.0159939374999999,
				-0.0083680254629629, -0.0001915462962965, 0.0069983657407408,
				0.0151460601851854, 0.0109950254629629, -0.0038242337962961,
				-0.0165559490740738, -0.0156917337962962, -0.0033778472222222,
				0.0039455462962962, 0.0091573958333329, 0.0101463472222219,
				0.0165054699074074, 0.0105737916666663, -0.0125310300925923,
				-0.0217951898148153, -0.0112524953703703, -0.0008601620370370,
				0.0007047337962963, 0.0063515138888886, 0.0090428726851851,
				0.0014288750000000, -0.0068981805555555, -0.0114723865740741,
				-0.0085805416666664, -0.0010641944444444, 0.0011870509259258,
				0.0032186435185185, 0.0093124837962958, 0.0128815023148143,
				0.0141873495370366, 0.0062834999999998, -0.0144124791666663,
				-0.0212140949074078, -0.0110202569444439, -0.0032141412037035,
				0.0022389768518516, 0.0073425138888884, 0.0071063703703703,
				0.0030361481481482, 0.0019436875000000, -0.0037201041666663,
				-0.0097066342592590, -0.0099665578703696, -0.0048980277777779,
				-0.0009184375000000, 0.0002101782407408, 0.0039700671296294,
				0.0095410694444442, 0.0111099374999994, 0.0090262615740738,
				0.0032387685185185, -0.0115637662037030, -0.0140435879629628,
				-0.0132667476851853, -0.0048658356481481, 0.0000684722222222,
				0.0048257453703703, 0.0084803032407400, 0.0048007199074072,
				0.0053713310185185, 0.0075305879629629, 0.0058815162037036,
				-0.0073704699074068, -0.0104603310185180, -0.0087475300925925,
				-0.0043787777777777, 0.0001571550925926, 0.0005325092592592,
				0.0036664537037037, 0.0046415300925923, 0.0081855949074068,
				0.0042360555555555, 0.0002744699074074, -0.0028760833333333,
				-0.0097570138888883, -0.0080036805555553, -0.0058469004629627,
				0.0002389351851852, 0.0008468888888889, 0.0043355300925924,
				0.0069591249999998, 0.0029960879629629, 0.0078999374999995,
				0.0096378333333328, 0.0101132430555552, 0.0032317407407405,
				-0.0060805462962964, -0.0164571296296296, -0.0117955625000001,
				-0.0062549814814815, -0.0034793240740740, 0.0026439675925926,
				0.0017249745370370, 0.0026657083333333, 0.0039783472222221,
				0.0037571597222222, 0.0041000509259259, 0.0040893125000000,
				0.0019451504629629, -0.0066412546296290, -0.0066592476851846,
				-0.0065936620370365, -0.0034776481481481, 0.0002485370370371,
				0.0007350393518518, 0.0003603472222222, 0.0016656712962963,
				0.0045264583333331, 0.0033100972222221, 0.0051281504629628,
				0.0025033726851852, 0.0038563819444444, 0.0001201736111111,
				-0.0073350787037031, -0.0088905416666659, -0.0103876851851841,
				-0.0033605532407407, -0.0017707337962963, 0.0003409745370370,
				0.0026302337962963, 0.0025492523148147, 0.0043698680555554,
				0.0016754953703704, 0.0025536342592592, 0.0021145601851852,
				0.0016473541666667, 0.0002549375000000, -0.0049311041666665,
				-0.0064134837962961, -0.0077119513888885, -0.0018127800925926,
				-0.0021909699074073, -0.0001732731481482, 0.0007887939814815,
				0.0009106018518519, 0.0008564722222222, 0.0008386134259259,
				0.0036815046296296, 0.0037949884259259, 0.0043315763888888,
				0.0010899861111111, -0.0173285231481483, -0.0214657569444483,
				-0.0198036851851897, -0.0169165763888917, -0.0143983425925939,
				-0.0080771157407382, -0.0059133657407384, -0.0032682314814807,
				-0.0024938333333327, -0.0010319976851851, -0.0001532685185185,
				0.3047234282407446, 0.1877120138888875, -0.0761624444444478,
				-0.0752061203703745, 0.1286556944444444, -0.2097957152777769,
				0.1104514421296318, -0.1855838726851819, 0.1116363449074147,
				-0.1442949861111110, 0.0660746967592720, -0.0636592314814917,
				-0.0232992662037055, -0.0182564953703721, -0.0259170115740779,
				-0.0370813587963107, -0.0245691226851949, -0.0168491736111170,
				0.0056667013888869, -0.0112575972222228, 0.0291708379629857,
				-0.0056828981481475, 0.0684043958333700, 0.0223212175925952,
				0.0107387523148152, -0.0521353958333534, 0.0753830694444660,
				-0.0206547199074071, 0.0400950254629727, -0.0619190254629794,
				-0.0221523287037056, 0.0361440694444523, -0.0421314212963108,
				0.0207212754629678, 0.0095920625000003, -0.0436127800926064,
				0.0474784699074245, 0.0064202291666661, 0.0056984745370359,
				0.0636762175926024, -0.0544268194444532, -0.0123475509259247,
				0.0521413402777856, -0.0441900486111156, -0.0444940486111239,
				0.0305057430555600, -0.0190502152777773, 0.0090183981481477,
				0.0469296365740839, -0.0220117384259271, 0.0433999652777840,
				-0.0301456666666706, 0.0329460763888927, 0.0056955578703710,
				0.0102971851851856, 0.0221915370370375, -0.0020990046296295,
				0.0251239976851857, 0.0435169444444476, -0.0134649097222220,
				-0.0611133912037077, -0.0118774583333336, -0.0332321967592601,
				-0.0672508078703763, -0.0726853032407544, -0.0328715324074316,
				-0.0008720023148148, -0.0009474606481481, 0.0104650046296287,
				0.0423444467592842, 0.0791196458333449, 0.0949649560185219,
				0.0787003703703737, -0.0152098032407426, 0.0776889675925984,
				0.0146725370370370, 0.1031089652777810 };

		// for (Part p : EnumSet.of(Part.training, Part.testing)) {
		// executor.submit(new MusicAttribMerge(latch, mean, ArffPathUtil
		// .getPath(p, Type.music, Preprocessed.all, Sampling.all),
		// ArffPathUtil.getPath(p, Type.music, Preprocessed.mergednew,
		// Sampling.all)));
		// }

		for (Part p : EnumSet.allOf(Part.class)) {
			String folder = ArffPathUtil.getPath(p, Type.music,
					Preprocessed.original);
			for (File f : new File(folder).listFiles()) {
				executor.submit(new MusicAttribMerge(latch, mean, f
						.getAbsolutePath(), ArffPathUtil.getPath(p, Type.music,
						Preprocessed.originalmergednew) + f.getName()));
			}
		}

		// wait until all runnables are completed
		try {
			latch.await();
		} catch (final InterruptedException e1) {
		}

		// shutdown executor
		executor.shutdown();
		try {
			executor.awaitTermination(EXECUTOR_SHUTDOWN_TIMEOUT,
					TimeUnit.SECONDS);
		} catch (final InterruptedException e) {
			executor.shutdownNow();
		}

		// TreeSet<EvaluationResult> sortedset = new TreeSet<>(
		// new Comparator<EvaluationResult>() {
		//
		// @Override
		// public int compare(EvaluationResult o1, EvaluationResult o2) {
		// int cmpTP = Double.compare(
		// o1.evaluation.truePositiveRate(0),
		// o2.evaluation.truePositiveRate(0));
		// return cmpTP == 0 ? Double.compare(
		// o1.evaluation.pctCorrect(),
		// o2.evaluation.pctCorrect()) : cmpTP;
		// }
		// });
		// sortedset.addAll(results);
		// for (EvaluationResult r : sortedset) {
		// System.out
		// .println(Arrays.asList(r.options)
		// + " : "
		// + String.format(
		// "correct: %7.4f FP (music): %7.4f TP (nomusic): %7.4f ROC: %7.4f",
		// r.evaluation.pctCorrect(),
		// r.evaluation.falsePositiveRate(0),
		// r.evaluation.truePositiveRate(1),
		// r.evaluation.areaUnderROC(0)));
		// }
	}
}
